package com.bonc.apicreator.entity;


import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Transient;

import lombok.Getter;
import lombok.Setter;


/**
 * api响应信息
 *
 * @author gaopengyu
 * @version 2016年8月5日
 * @see RestApiResponse
 * @since
 */
@Setter
@Getter
@Entity
public class RestApiResponse {
    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;// 主键id

    /**
     * 编码
     */
    private String code;

    /**
     * 描述
     */
    private String description;

    /**
     * 对应字段名称
     */
    private String columnName;

    /**
     * 类型 type字段说明 1:string 2:int 3:boolean 4:long 5:double 6:float 7:decimal 8:file
     */
    private String type;

    /**
     * 所属api的Id
     */
    private Long apiId;

    /**
     * nodeId
     */
    private String nodeId;

    /**
     * parentId
     */
    private String parentId;

    /**
     * 节点集合
     */
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String childrenList;

    /**
     * topId
     */
    private Long topId;

    /**
     * 子节点列表
     */
    @Transient
    List<RestApiResponse> children = new ArrayList<RestApiResponse>();

    /**
     * 创建时间
     */
    private Date createDate;
    
    /**
     * count类型用
     */
    private String dataType;
}
